package com.baselibrary.net;


/**
 * @author zhanglijie
 * @date 20-3-10
 * @Description
 */
public class MyHttpUtil extends BaseHttpUtil {

    private final HttpHelper mHttpHelper = BaseHttpUtil.getHttpHelper();

    protected MyHttpUtil() {

    }

    public static MyHttpUtil getInstance() {
        return SingletonHolder.INSTANCE;
    }

    public <T> T getApi(Class<T> t) {
        return (T) mHttpHelper.getService(t, Request.HOST);
    }

    public <T> T getApi(Class<T> t, String url) {
        return (T) mHttpHelper.getService(t, url);
    }

    private static class SingletonHolder {
        private static final MyHttpUtil INSTANCE = new MyHttpUtil();
    }

}
